import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';

declare var Swiper;

@Component({
    selector: 'app-template-var',
    templateUrl: './template-var.component.html',
    styleUrls: ['./template-var.component.less']
})
export class TemplateVarComponent implements OnInit {
    
    @ViewChild("loop1",{
        static:true
    })
    loopDom:ElementRef;
    constructor() { }

    ngOnInit() {
        console.log(this.loopDom);
        this.initSwiper(this.loopDom.nativeElement);

    }
    printDom(dom){
        console.log(dom);
        console.log(this.loopDom);
        console.log(this.loopDom.nativeElement);
    }
    initSwiper(loop){
        console.log("initSwiper 方法被执行")
        new Swiper(loop,{});
    }

}
